<?php
header('Content-type: application/json; charset=UTF-8');

if (!mysql_connect("localhost","root","magnets")) {
	echo 'Problem!';
}

mysql_select_db("refrigerator");
	
$result = mysql_query("SELECT id, title FROM problems");
	
$rows = array();
	
while($r = mysql_fetch_assoc($result)) {	
		$rows[] = $r;
}
	
echo json_encode($rows);

?>